﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.IO;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria.ModLoader.IO;
using Terraria.Utilities;

namespace Terraria.ModLoader
{
	// Token: 0x02000191 RID: 401
	public class GlobalItem
	{
		// Token: 0x17000127 RID: 295
		// (get) Token: 0x06000FC6 RID: 4038 RVA: 0x0000EA53 File Offset: 0x0000CC53
		// (set) Token: 0x06000FC7 RID: 4039 RVA: 0x0000EA5B File Offset: 0x0000CC5B
		public Mod mod { get; internal set; }

		// Token: 0x17000128 RID: 296
		// (get) Token: 0x06000FC8 RID: 4040 RVA: 0x0000EA64 File Offset: 0x0000CC64
		// (set) Token: 0x06000FC9 RID: 4041 RVA: 0x0000EA6C File Offset: 0x0000CC6C
		public string Name { get; internal set; }

		// Token: 0x06000FCA RID: 4042 RVA: 0x0000EA75 File Offset: 0x0000CC75
		public virtual bool Autoload(ref string name)
		{
			return this.mod.Properties.Autoload;
		}

		// Token: 0x17000129 RID: 297
		// (get) Token: 0x06000FCB RID: 4043 RVA: 0x0000ADF8 File Offset: 0x00008FF8
		public virtual bool InstancePerEntity
		{
			get
			{
				return false;
			}
		}

		// Token: 0x06000FCC RID: 4044 RVA: 0x0000EA87 File Offset: 0x0000CC87
		public GlobalItem Instance(Item item)
		{
			if (!this.InstancePerEntity)
			{
				return this;
			}
			return item.globalItems[this.instanceIndex];
		}

		// Token: 0x1700012A RID: 298
		// (get) Token: 0x06000FCD RID: 4045 RVA: 0x0000ADF8 File Offset: 0x00008FF8
		public virtual bool CloneNewInstances
		{
			get
			{
				return false;
			}
		}

		// Token: 0x06000FCE RID: 4046 RVA: 0x0000EAA0 File Offset: 0x0000CCA0
		public virtual GlobalItem Clone()
		{
			return (GlobalItem)base.MemberwiseClone();
		}

		// Token: 0x06000FCF RID: 4047 RVA: 0x0000EAAD File Offset: 0x0000CCAD
		public virtual GlobalItem Clone(Item item, Item itemClone)
		{
			return this.NewInstance(item);
		}

		// Token: 0x06000FD0 RID: 4048 RVA: 0x00404F24 File Offset: 0x00403124
		public virtual GlobalItem NewInstance(Item item)
		{
			if (this.CloneNewInstances)
			{
				return this.Clone();
			}
			GlobalItem globalItem = (GlobalItem)Activator.CreateInstance(base.GetType());
			globalItem.mod = this.mod;
			globalItem.Name = this.Name;
			globalItem.index = this.index;
			globalItem.instanceIndex = this.instanceIndex;
			return globalItem;
		}

		// Token: 0x06000FD1 RID: 4049 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void SetDefaults(Item item)
		{
		}

		// Token: 0x06000FD2 RID: 4050 RVA: 0x0000EAB6 File Offset: 0x0000CCB6
		public virtual int ChoosePrefix(Item item, UnifiedRandom rand)
		{
			return -1;
		}

		// Token: 0x06000FD3 RID: 4051 RVA: 0x00008CF7 File Offset: 0x00006EF7
		public virtual bool CanUseItem(Item item, Player player)
		{
			return true;
		}

		// Token: 0x06000FD4 RID: 4052 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void UseStyle(Item item, Player player)
		{
		}

		// Token: 0x06000FD5 RID: 4053 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void HoldStyle(Item item, Player player)
		{
		}

		// Token: 0x06000FD6 RID: 4054 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void HoldItem(Item item, Player player)
		{
		}

		// Token: 0x06000FD7 RID: 4055 RVA: 0x0000EAB9 File Offset: 0x0000CCB9
		public virtual float UseTimeMultiplier(Item item, Player player)
		{
			return 1f;
		}

		// Token: 0x06000FD8 RID: 4056 RVA: 0x0000EAB9 File Offset: 0x0000CCB9
		public virtual float MeleeSpeedMultiplier(Item item, Player player)
		{
			return 1f;
		}

		// Token: 0x06000FD9 RID: 4057 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void GetWeaponDamage(Item item, Player player, ref int damage)
		{
		}

		// Token: 0x06000FDA RID: 4058 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void GetWeaponKnockback(Item item, Player player, ref float knockback)
		{
		}

		// Token: 0x06000FDB RID: 4059 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void GetWeaponCrit(Item item, Player player, ref int crit)
		{
		}

		// Token: 0x06000FDC RID: 4060 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void PickAmmo(Item item, Player player, ref int type, ref float speed, ref int damage, ref float knockback)
		{
		}

		// Token: 0x06000FDD RID: 4061 RVA: 0x00008CF7 File Offset: 0x00006EF7
		public virtual bool ConsumeAmmo(Item item, Player player)
		{
			return true;
		}

		// Token: 0x06000FDE RID: 4062 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void OnConsumeAmmo(Item item, Player player)
		{
		}

		// Token: 0x06000FDF RID: 4063 RVA: 0x00008CF7 File Offset: 0x00006EF7
		public virtual bool Shoot(Item item, Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
		{
			return true;
		}

		// Token: 0x06000FE0 RID: 4064 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void UseItemHitbox(Item item, Player player, ref Rectangle hitbox, ref bool noHitbox)
		{
		}

		// Token: 0x06000FE1 RID: 4065 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void MeleeEffects(Item item, Player player, Rectangle hitbox)
		{
		}

		// Token: 0x06000FE2 RID: 4066 RVA: 0x00404F84 File Offset: 0x00403184
		public virtual bool? CanHitNPC(Item item, Player player, NPC target)
		{
			return null;
		}

		// Token: 0x06000FE3 RID: 4067 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void ModifyHitNPC(Item item, Player player, NPC target, ref int damage, ref float knockBack, ref bool crit)
		{
		}

		// Token: 0x06000FE4 RID: 4068 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void OnHitNPC(Item item, Player player, NPC target, int damage, float knockBack, bool crit)
		{
		}

		// Token: 0x06000FE5 RID: 4069 RVA: 0x00008CF7 File Offset: 0x00006EF7
		public virtual bool CanHitPvp(Item item, Player player, Player target)
		{
			return true;
		}

		// Token: 0x06000FE6 RID: 4070 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void ModifyHitPvp(Item item, Player player, Player target, ref int damage, ref bool crit)
		{
		}

		// Token: 0x06000FE7 RID: 4071 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void OnHitPvp(Item item, Player player, Player target, int damage, bool crit)
		{
		}

		// Token: 0x06000FE8 RID: 4072 RVA: 0x0000ADF8 File Offset: 0x00008FF8
		public virtual bool UseItem(Item item, Player player)
		{
			return false;
		}

		// Token: 0x06000FE9 RID: 4073 RVA: 0x00008CF7 File Offset: 0x00006EF7
		public virtual bool ConsumeItem(Item item, Player player)
		{
			return true;
		}

		// Token: 0x06000FEA RID: 4074 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void OnConsumeItem(Item item, Player player)
		{
		}

		// Token: 0x06000FEB RID: 4075 RVA: 0x0000ADF8 File Offset: 0x00008FF8
		public virtual bool UseItemFrame(Item item, Player player)
		{
			return false;
		}

		// Token: 0x06000FEC RID: 4076 RVA: 0x0000ADF8 File Offset: 0x00008FF8
		public virtual bool HoldItemFrame(Item item, Player player)
		{
			return false;
		}

		// Token: 0x06000FED RID: 4077 RVA: 0x0000ADF8 File Offset: 0x00008FF8
		public virtual bool AltFunctionUse(Item item, Player player)
		{
			return false;
		}

		// Token: 0x06000FEE RID: 4078 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void UpdateInventory(Item item, Player player)
		{
		}

		// Token: 0x06000FEF RID: 4079 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void UpdateEquip(Item item, Player player)
		{
		}

		// Token: 0x06000FF0 RID: 4080 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void UpdateAccessory(Item item, Player player, bool hideVisual)
		{
		}

		// Token: 0x06000FF1 RID: 4081 RVA: 0x0000EAC0 File Offset: 0x0000CCC0
		public virtual string IsArmorSet(Item head, Item body, Item legs)
		{
			return "";
		}

		// Token: 0x06000FF2 RID: 4082 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void UpdateArmorSet(Player player, string set)
		{
		}

		// Token: 0x06000FF3 RID: 4083 RVA: 0x00404F9C File Offset: 0x0040319C
		public virtual string IsVanitySet(int head, int body, int legs)
		{
			Item item = new Item();
			if (head >= 0)
			{
				item.SetDefaults(Item.headType[head], true);
			}
			Item item2 = new Item();
			if (body >= 0)
			{
				item2.SetDefaults(Item.bodyType[body], true);
			}
			Item item3 = new Item();
			if (legs >= 0)
			{
				item3.SetDefaults(Item.legType[legs], true);
			}
			return this.IsArmorSet(item, item2, item3);
		}

		// Token: 0x06000FF4 RID: 4084 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void PreUpdateVanitySet(Player player, string set)
		{
		}

		// Token: 0x06000FF5 RID: 4085 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void UpdateVanitySet(Player player, string set)
		{
		}

		// Token: 0x06000FF6 RID: 4086 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void ArmorSetShadows(Player player, string set)
		{
		}

		// Token: 0x06000FF7 RID: 4087 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void SetMatch(int armorSlot, int type, bool male, ref int equipSlot, ref bool robes)
		{
		}

		// Token: 0x06000FF8 RID: 4088 RVA: 0x0000ADF8 File Offset: 0x00008FF8
		public virtual bool CanRightClick(Item item)
		{
			return false;
		}

		// Token: 0x06000FF9 RID: 4089 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void RightClick(Item item, Player player)
		{
		}

		// Token: 0x06000FFA RID: 4090 RVA: 0x00008CF7 File Offset: 0x00006EF7
		public virtual bool PreOpenVanillaBag(string context, Player player, int arg)
		{
			return true;
		}

		// Token: 0x06000FFB RID: 4091 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void OpenVanillaBag(string context, Player player, int arg)
		{
		}

		// Token: 0x06000FFC RID: 4092 RVA: 0x00008CF7 File Offset: 0x00006EF7
		public virtual bool ReforgePrice(Item item, ref int reforgePrice, ref bool canApplyDiscount)
		{
			return true;
		}

		// Token: 0x06000FFD RID: 4093 RVA: 0x00008CF7 File Offset: 0x00006EF7
		public virtual bool NewPreReforge(Item item)
		{
			return true;
		}

		// Token: 0x06000FFE RID: 4094 RVA: 0x0000EAC7 File Offset: 0x0000CCC7
		[Obsolete("PreReforge now returns a bool to control whether the reforge takes place. For now, use NewPreReforge")]
		public virtual void PreReforge(Item item)
		{
			this.NewPreReforge(item);
		}

		// Token: 0x06000FFF RID: 4095 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void PostReforge(Item item)
		{
		}

		// Token: 0x06001000 RID: 4096 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void DrawHands(int body, ref bool drawHands, ref bool drawArms)
		{
		}

		// Token: 0x06001001 RID: 4097 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void DrawHair(int head, ref bool drawHair, ref bool drawAltHair)
		{
		}

		// Token: 0x06001002 RID: 4098 RVA: 0x00008CF7 File Offset: 0x00006EF7
		public virtual bool DrawHead(int head)
		{
			return true;
		}

		// Token: 0x06001003 RID: 4099 RVA: 0x00008CF7 File Offset: 0x00006EF7
		public virtual bool DrawBody(int body)
		{
			return true;
		}

		// Token: 0x06001004 RID: 4100 RVA: 0x00008CF7 File Offset: 0x00006EF7
		public virtual bool DrawLegs(int legs, int shoes)
		{
			return true;
		}

		// Token: 0x06001005 RID: 4101 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void DrawArmorColor(EquipType type, int slot, Player drawPlayer, float shadow, ref Color color, ref int glowMask, ref Color glowMaskColor)
		{
		}

		// Token: 0x06001006 RID: 4102 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void ArmorArmGlowMask(int slot, Player drawPlayer, float shadow, ref int glowMask, ref Color color)
		{
		}

		// Token: 0x06001007 RID: 4103 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void VerticalWingSpeeds(Item item, Player player, ref float ascentWhenFalling, ref float ascentWhenRising, ref float maxCanAscendMultiplier, ref float maxAscentMultiplier, ref float constantAscend)
		{
		}

		// Token: 0x06001008 RID: 4104 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void HorizontalWingSpeeds(Item item, Player player, ref float speed, ref float acceleration)
		{
		}

		// Token: 0x06001009 RID: 4105 RVA: 0x0000ADF8 File Offset: 0x00008FF8
		public virtual bool WingUpdate(int wings, Player player, bool inUse)
		{
			return false;
		}

		// Token: 0x0600100A RID: 4106 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void Update(Item item, ref float gravity, ref float maxFallSpeed)
		{
		}

		// Token: 0x0600100B RID: 4107 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void PostUpdate(Item item)
		{
		}

		// Token: 0x0600100C RID: 4108 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void GrabRange(Item item, Player player, ref int grabRange)
		{
		}

		// Token: 0x0600100D RID: 4109 RVA: 0x0000ADF8 File Offset: 0x00008FF8
		public virtual bool GrabStyle(Item item, Player player)
		{
			return false;
		}

		// Token: 0x0600100E RID: 4110 RVA: 0x00008CF7 File Offset: 0x00006EF7
		public virtual bool CanPickup(Item item, Player player)
		{
			return true;
		}

		// Token: 0x0600100F RID: 4111 RVA: 0x00008CF7 File Offset: 0x00006EF7
		public virtual bool OnPickup(Item item, Player player)
		{
			return true;
		}

		// Token: 0x06001010 RID: 4112 RVA: 0x0000ADF8 File Offset: 0x00008FF8
		public virtual bool ItemSpace(Item item, Player player)
		{
			return false;
		}

		// Token: 0x06001011 RID: 4113 RVA: 0x00404FFC File Offset: 0x004031FC
		public virtual Color? GetAlpha(Item item, Color lightColor)
		{
			return null;
		}

		// Token: 0x06001012 RID: 4114 RVA: 0x00008CF7 File Offset: 0x00006EF7
		public virtual bool PreDrawInWorld(Item item, SpriteBatch spriteBatch, Color lightColor, Color alphaColor, ref float rotation, ref float scale, int whoAmI)
		{
			return true;
		}

		// Token: 0x06001013 RID: 4115 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void PostDrawInWorld(Item item, SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
		{
		}

		// Token: 0x06001014 RID: 4116 RVA: 0x00008CF7 File Offset: 0x00006EF7
		public virtual bool PreDrawInInventory(Item item, SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale)
		{
			return true;
		}

		// Token: 0x06001015 RID: 4117 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void PostDrawInInventory(Item item, SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale)
		{
		}

		// Token: 0x06001016 RID: 4118 RVA: 0x00405014 File Offset: 0x00403214
		public virtual Vector2? HoldoutOffset(int type)
		{
			return null;
		}

		// Token: 0x06001017 RID: 4119 RVA: 0x00405014 File Offset: 0x00403214
		public virtual Vector2? HoldoutOrigin(int type)
		{
			return null;
		}

		// Token: 0x06001018 RID: 4120 RVA: 0x00008CF7 File Offset: 0x00006EF7
		public virtual bool CanEquipAccessory(Item item, Player player, int slot)
		{
			return true;
		}

		// Token: 0x06001019 RID: 4121 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void ExtractinatorUse(int extractType, ref int resultType, ref int resultStack)
		{
		}

		// Token: 0x0600101A RID: 4122 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void CaughtFishStack(int type, ref int stack)
		{
		}

		// Token: 0x0600101B RID: 4123 RVA: 0x00008CF7 File Offset: 0x00006EF7
		public virtual bool IsAnglerQuestAvailable(int type)
		{
			return true;
		}

		// Token: 0x0600101C RID: 4124 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void AnglerChat(int type, ref string chat, ref string catchLocation)
		{
		}

		// Token: 0x0600101D RID: 4125 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void OnCraft(Item item, Recipe recipe)
		{
		}

		// Token: 0x0600101E RID: 4126 RVA: 0x00008CF7 File Offset: 0x00006EF7
		public virtual bool PreDrawTooltip(Item item, ReadOnlyCollection<TooltipLine> lines, ref int x, ref int y)
		{
			return true;
		}

		// Token: 0x0600101F RID: 4127 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void PostDrawTooltip(Item item, ReadOnlyCollection<DrawableTooltipLine> lines)
		{
		}

		// Token: 0x06001020 RID: 4128 RVA: 0x00008CF7 File Offset: 0x00006EF7
		public virtual bool PreDrawTooltipLine(Item item, DrawableTooltipLine line, ref int yOffset)
		{
			return true;
		}

		// Token: 0x06001021 RID: 4129 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void PostDrawTooltipLine(Item item, DrawableTooltipLine line)
		{
		}

		// Token: 0x06001022 RID: 4130 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void ModifyTooltips(Item item, List<TooltipLine> tooltips)
		{
		}

		// Token: 0x06001023 RID: 4131 RVA: 0x0000ADF8 File Offset: 0x00008FF8
		public virtual bool NeedsSaving(Item item)
		{
			return false;
		}

		// Token: 0x06001024 RID: 4132 RVA: 0x0000D858 File Offset: 0x0000BA58
		public virtual TagCompound Save(Item item)
		{
			return null;
		}

		// Token: 0x06001025 RID: 4133 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void Load(Item item, TagCompound tag)
		{
		}

		// Token: 0x06001026 RID: 4134 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void LoadLegacy(Item item, BinaryReader reader)
		{
		}

		// Token: 0x06001027 RID: 4135 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void NetSend(Item item, BinaryWriter writer)
		{
		}

		// Token: 0x06001028 RID: 4136 RVA: 0x00006B58 File Offset: 0x00004D58
		public virtual void NetReceive(Item item, BinaryReader reader)
		{
		}

		// Token: 0x0400134E RID: 4942
		internal int index;

		// Token: 0x0400134F RID: 4943
		internal int instanceIndex;
	}
}
